﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineRenderingShaderKeywordWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.Rendering.ShaderKeyword);
			Utils.BeginObjectRegister(type, L, translator, 0, 1, 1, 0);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsValid", _m_IsValid);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "index", _g_get_index);
            
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 6, 0, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "GetGlobalKeywordName", _m_GetGlobalKeywordName_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetGlobalKeywordType", _m_GetGlobalKeywordType_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "IsKeywordLocal", _m_IsKeywordLocal_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetKeywordName", _m_GetKeywordName_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetKeywordType", _m_GetKeywordType_xlua_st_);
            
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
				{
					string _keywordName = LuaAPI.lua_tostring(L, 2);
					
					var gen_ret = new UnityEngine.Rendering.ShaderKeyword(_keywordName);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.Shader>(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
				{
					UnityEngine.Shader _shader = (UnityEngine.Shader)translator.GetObject(L, 2, typeof(UnityEngine.Shader));
					string _keywordName = LuaAPI.lua_tostring(L, 3);
					
					var gen_ret = new UnityEngine.Rendering.ShaderKeyword(_shader, _keywordName);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.ComputeShader>(L, 2) && (LuaAPI.lua_isnil(L, 3) || LuaAPI.lua_type(L, 3) == LuaTypes.LUA_TSTRING))
				{
					UnityEngine.ComputeShader _shader = (UnityEngine.ComputeShader)translator.GetObject(L, 2, typeof(UnityEngine.ComputeShader));
					string _keywordName = LuaAPI.lua_tostring(L, 3);
					
					var gen_ret = new UnityEngine.Rendering.ShaderKeyword(_shader, _keywordName);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
				if (LuaAPI.lua_gettop(L) == 1)
				{
				    translator.Push(L, default(UnityEngine.Rendering.ShaderKeyword));
			        return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Rendering.ShaderKeyword constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetGlobalKeywordName_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 1, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.GetGlobalKeywordName( _index );
                        LuaAPI.lua_pushstring(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetGlobalKeywordType_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 1, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.GetGlobalKeywordType( _index );
                        translator.PushUnityEngineRenderingShaderKeywordType(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_IsKeywordLocal_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 1, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.IsKeywordLocal( _index );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetKeywordName_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.Shader>(L, 1)&& translator.Assignable<UnityEngine.Rendering.ShaderKeyword>(L, 2)) 
                {
                    UnityEngine.Shader _shader = (UnityEngine.Shader)translator.GetObject(L, 1, typeof(UnityEngine.Shader));
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 2, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.GetKeywordName( _shader, _index );
                        LuaAPI.lua_pushstring(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.ComputeShader>(L, 1)&& translator.Assignable<UnityEngine.Rendering.ShaderKeyword>(L, 2)) 
                {
                    UnityEngine.ComputeShader _shader = (UnityEngine.ComputeShader)translator.GetObject(L, 1, typeof(UnityEngine.ComputeShader));
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 2, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.GetKeywordName( _shader, _index );
                        LuaAPI.lua_pushstring(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Rendering.ShaderKeyword.GetKeywordName!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetKeywordType_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.Shader>(L, 1)&& translator.Assignable<UnityEngine.Rendering.ShaderKeyword>(L, 2)) 
                {
                    UnityEngine.Shader _shader = (UnityEngine.Shader)translator.GetObject(L, 1, typeof(UnityEngine.Shader));
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 2, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.GetKeywordType( _shader, _index );
                        translator.PushUnityEngineRenderingShaderKeywordType(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& translator.Assignable<UnityEngine.ComputeShader>(L, 1)&& translator.Assignable<UnityEngine.Rendering.ShaderKeyword>(L, 2)) 
                {
                    UnityEngine.ComputeShader _shader = (UnityEngine.ComputeShader)translator.GetObject(L, 1, typeof(UnityEngine.ComputeShader));
                    UnityEngine.Rendering.ShaderKeyword _index;translator.Get(L, 2, out _index);
                    
                        var gen_ret = UnityEngine.Rendering.ShaderKeyword.GetKeywordType( _shader, _index );
                        translator.PushUnityEngineRenderingShaderKeywordType(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Rendering.ShaderKeyword.GetKeywordType!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_IsValid(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.Rendering.ShaderKeyword gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
            
            
                
                {
                    
                        var gen_ret = gen_to_be_invoked.IsValid(  );
                        LuaAPI.lua_pushboolean(L, gen_ret);
                    
                    
                        translator.Update(L, 1, gen_to_be_invoked);
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_index(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Rendering.ShaderKeyword gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.index);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        
        
		
		
		
		
    }
}
